<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Helper\Kdbird as KdbirdExtend;

class Kdbird extends Model
{



    /**
     * 查询物流轨迹 并且转化为兼容数据结构
     * @param $code
     * @param $express_no
     * @return array
     */
    public function trace($code, $express_no){

        $config['EBusinessID'] = "";
        $config["AppKey"] = "";
        $kd100_extend = new KdbirdExtend($config);
        $result = $kd100_extend->orderTracesSubByJson($express_no, $code);
        if (isset($result['success']) && $result['success']) {
            return $result;
        } else {
            return $result['reason'];
        }

    }


}
